﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package L10n {
    import L10n.LocaleSettings.*;

    public class LocaleHelper {

        public static const SNS_FACEBOOK:String = "sns_facebook";
        public static const SNS_PENGYOU:String = "sns_pengyou";

        public static var en_US:String = "en_US";
        public static var zh_CN:String = "zh_CN";
        private static var m_locale:String = zh_CN;
        private static var m_localeSetting:LocaleSetting;

        public static function set locale(_arg1:String):void{
            if (Global.isSandbox){
                m_locale = _arg1;
                switch (_arg1){
                    case LocaleHelper.en_US:
                        m_localeSetting = new LocaleSetting_enUS(SNS_FACEBOOK);
                        break;
                    case LocaleHelper.zh_CN:
                        m_localeSetting = new LocaleSetting_zhCN(SNS_PENGYOU);
                        break;
                    default:
                        m_localeSetting = new LocaleSetting_zhCN(SNS_PENGYOU);
                };
            } else {
                m_locale = "zh_CN";
                m_localeSetting = new LocaleSetting_zhCN(SNS_PENGYOU);
            };
        }
        public static function getLangByURL(_arg1:String):String{
            var _local2:RegExp;
            if (Global.isSandbox){
                _local2 = /\/(\w+(_\w+)?)\.xml/g;
                return (_local2.exec(_arg1)[1]);
            };
            return ("zh_CN");
        }
        public static function get localSetting():LocaleSetting{
            return (m_localeSetting);
        }
        public static function get locale():String{
            return (m_locale);
        }

    }
}//package L10n 
